import CryptoJS from 'crypto-js';

const key = 'duodian';

// 加密
export const encrypt = (data) => {
    var ciphertext = CryptoJS.AES.encrypt(data,key).toString();
    return ciphertext
}

// 解密
export const decrypt = (data) => {
    // Decrypt
    var bytes  = CryptoJS.AES.decrypt(data,key);
    var originalText = bytes.toString(CryptoJS.enc.Utf8);
    return originalText
}
 
